<?php
$pg = "home";

$userDao = new UsersDao();
if ( isset ($_SESSION['user']))
{
    $user = $userDao->check($connection, $_SESSION['user'], $_SESSION['pass']);
    if (!$user->getUsername())
    {
        header("Location: ./?pg=login&logout");
    }
    $smarty->assign("user", $user);
}
else
    header("Location: ./?pg=login&logout");



?>
